package com.qf.service.Impl;

import com.qf.mapper.FangxingMapper;
import com.qf.pojo.Fangxing;
import com.qf.service.FangxingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FangxingServiceImpl implements FangxingService {
    @Autowired
    private FangxingMapper fangxingMapper;

    @Override
    public List<Fangxing> selectFangxingByJid(Integer jid) {
        List<Fangxing> fangxings = fangxingMapper.selectFangxingByJid(jid);
        return fangxings;
    }

    @Override
    public List<Fangxing> selectAll() {
        List<Fangxing> fangxings = fangxingMapper.selectAll();
        return fangxings;
    }

    @Override
    public Fangxing selectFangxingByFid(Integer fid) {
        Fangxing fangxing = fangxingMapper.selectByPrimaryKey(fid);
        return fangxing;
    }

    @Override
    public void deleteFangxingByFid(Integer fid) {
        fangxingMapper.deleteByPrimaryKey(fid);
    }

    @Override
    public void addFangxing(Fangxing fangxing) {
        fangxingMapper.insert(fangxing);
    }

    @Override
    public void updateFangxing(Fangxing fangxing) {
        fangxingMapper.updateByPrimaryKey(fangxing);
        System.out.println("3333");
    }
}
